package com.blog.controller;

import com.blog.entity.BlogFriendAddress;
import com.blog.service.FriendAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;

/**
 * @Author Huangzp
 * @Date 2022/1/10 14:33
 */
@RestController
@RequestMapping("/friend-address")
public class FriendAddressController {

    @Autowired
    private FriendAddressService friendAddressService;

    @GetMapping("getFriendAddress")
    public HashMap<String, Object> getFriendAddress(){
        HashMap<String, Object> result = new HashMap<>();
        List<BlogFriendAddress> friendAddresses = friendAddressService.list();
        result.put("data",friendAddresses);
        return result;
    }
}
